<!DOCTYPE html>
<html>
{% load staticfiles %}
<head>
  <meta charset="UTF-8">
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>{% block title %}个人信息- 博学谷在线网{% endblock %}</title>
  <link rel="stylesheet" href="{% static 'css/reset.css' %}">
  <link rel="stylesheet" href="{% static 'css/animate.css' %}">
  <link rel="stylesheet" href="{% static 'css/style.css' %}">
  <link rel="stylesheet" href="{% static 'js/plugins/queryCity/css/cityLayout.css' %}">

  <link rel="stylesheet" href="{% static 'css/lq.datetimepick.css' %}"/>

  {% block custom_css %}
  {% endblock %}
  <script src="{% static 'js/jquery.min.js' %}"></script>
  <script src="{% static 'js/jquery-migrate-1.2.1.min.js' %}"></script>

</head>
<body>
<section class="headerwrap headerwrap2">
  <header>
    <div class=" header header2">
      <div class="top">
        <div class="wp">
          <div class="fl"><p>服务电话：<b>33333333</b></p></div>
          <!--登录后跳转-->
          {% if request.user.is_authenticated %}
            <div class="personal">
              <dl class="user fr">
                <dd>{{ request.user.nick_name }}<img class="down fr" src="{% static 'images/top_down.png' %}"/></dd>
                <dt><img width="20" height="20" src="/static{{ MEDIA_URL }}{{ request.user.image }}"/></dt>
              </dl>
              <div class="userdetail">
                <dl>
                  <dt><img width="80" height="80" src="/static{{ MEDIA_URL }}{{ request.user.image }}" /></dt>
                  <dd>
                    <h2>{{ request.user.nick_name }}</h2>
                    <p>{{ request.user.username }}</p>
                  </dd>
                </dl>
                <div class="btn">
                  <a class="personcenter fl" href="{% url 'users:user_info' %}">进入个人中心</a>
                  <a class="fr" href="{% url 'logout' %}">退出</a>
                </div>
              </div>
            </div>
            <a href="{% url 'users:mymessage' %}">
              <div class="msg-num">
                <span id="MsgNum">{{ request.user.unread_nums }}</span>
              </div>
            </a>
          {% else %}
            <a style="color:white" class="fr registerbtn" href="{% url 'register' %}">注册</a>
            <a style="color:white" class="fr loginbtn" href="{% url 'login' %}">登录</a>
          {% endif %}

        </div>
      </div>

      <div class="middle">
        <div class="wp">
          <a href="{% url 'index' %}"><img class="fl" src="{% static 'images/logo.jpg' %}" id="boxue" width="140px" height="60px" /></a>
          <div class="searchbox fr">
            <div class="selectContainer fl">
                            <span class="selectOption" id="jsSelectOption" data-value="course">
                                公开课
                            </span>
              <ul class="selectMenu" id="jsSelectMenu">
                <li data-value="course">公开课</li>
                <li data-value="org">课程学校</li>
                <li data-value="teacher">授课老师</li>
              </ul>
            </div>
            <input id="search_keywords" class="fl" type="text" value="" placeholder="请输入搜索内容"/>
            <img class="search_btn fr" id="jsSearchBtn" src="{% static 'images/search_btn.png' %}"/>
          </div>
        </div>
      </div>


      <nav>
        <div class="nav">
          <div class="wp">
            <ul>
              <li class="{% ifequal request.path '/' %}active{% endifequal %}"><a href="{% url 'index' %}">首页</a></li>
              <li class="{% ifequal request.path|slice:'7' '/course' %}active{% endifequal %}">
                <a href="{% url 'courses:course_list' %}">
                  公开课<img class="hot" src="{% static 'images/nav_hot.png' %}">
                </a>
              </li>
              <li class="{% ifequal request.path|slice:'17' '/org/teacher/list' %}active{% endifequal %}">
                <a href="{% url 'org:teacher_list' %}">授课教师</a>
              </li>
              <li class="{% ifequal request.path|slice:'9' '/org/list' %}active{% endifequal %}"><a href="{% url 'org:org_list' %}">授课学校</a></li>
            </ul>
          </div>
        </div>
      </nav>

    </div>
  </header>
</section>


<!--crumbs start-->
{% block custom_bread %}
<section>
  <div class="wp">
    <ul class="crumbs">
      <li><a href="{% url 'index' %}">首页</a>></li>
      <li><a href="{% url 'users:user_info' %}">个人中心</a>></li>
      <li>个人信息</li>
    </ul>
  </div>
</section>
{% endblock %}

<section>
  <div class="wp list personal_list">
    <div class="left">
      <ul>
        <li class="active2"><a href="{% url 'users:user_info' %}">个人资料</a></li>
        <li><a href="{% url 'users:mycourse' %}">我的课程</a></li>
        <li><a href="{% url 'users:myfav_org' %}">我的收藏</a></li>
        <li>
          <a href="{% url 'users:mymessage' %}" style="position: relative;">
            我的消息
          </a>
        </li>
      </ul>
    </div>

    {% block right_content %}
    {% endblock %}

  </div>
</section>

<script src="{% static 'js/selectUi.js' %}" type='text/javascript'></script>
<script src="{% static 'js/plugins/laydate/laydate.js' %}"></script>
<script src="{% static 'js/plugins/layer/layer.js' %}"></script>
<script src="{% static 'js/plugins/queryCity/js/public.js' %}"></script>
<script src="{% static 'js/unslider.js' %}"></script>
<script src="{% static 'js/plugins/jquery.scrollLoading.js' %}"></script>
<script src="{% static 'js/validateDialog.js' %}"></script>
<script src="{% static 'js/deco-common.js' %}"></script>

<script src="{% static 'js/plugins/jquery.upload.js' %}" type='text/javascript'></script>
<script src="{% static 'js/validate.js' %}"></script>
<script src="{% static 'js/deco-user.js' %}"></script>

{% block custom_js %}
{% endblock %}

<script>
  // 课程取消收藏
  $('.jsDeleteFav_course').on('click', function () {
    var _this = $(this),
      favid = _this.attr('data-favid');
    $.ajax({
      cache: false,
      type: "POST",
      url: "{% url 'org:add_fav' %}",
      data: {
        fav_type: 1,
        fav_id: favid,
        csrfmiddlewaretoken: "{{ csrf_token }}",
      },
      async: true,
      success: function (data) {
        Dml.fun.winReload();
      }
    });
  });

  $('.jsDeleteFav_teacher').on('click', function () {
    var _this = $(this),
      favid = _this.attr('data-favid');
    $.ajax({
      cache: false,
      type: "POST",
      url: "{% url 'org:add_fav' %}",
      data: {
        fav_type: 3,
        fav_id: favid,
        csrfmiddlewaretoken: "{{ csrf_token }}",
      },
      async: true,
      success: function (data) {
        Dml.fun.winReload();
      }
    });
  });


  $('.jsDeleteFav_org').on('click', function () {
    var _this = $(this),
      favid = _this.attr('data-favid');
    $.ajax({
      cache: false,
      type: "POST",
      url: "{% url 'org:add_fav' %}",
      data: {
        fav_type: 2,
        fav_id: favid,
        csrfmiddlewaretoken: "{{ csrf_token }}",
      },
      async: true,
      success: function (data) {
        Dml.fun.winReload();
      }
    });
  });
</script>


<script>
  var shareUrl = '',
    shareText = '',
    shareDesc = '',
    shareComment = '';
  $(function () {
    $(".bdsharebuttonbox a").mouseover(function () {
      var type = $(this).attr('data-cmd'),
        $parent = $(this).parent('.bdsharebuttonbox'),
        fxurl = $parent.attr('data-url'),
        fxtext = $parent.attr('data-text'),
        fxdesc = $parent.attr('data-desc'),
        fxcomment = $parent.attr('data-comment');
      switch (type) {
        case 'tsina':
        case 'tqq':
        case 'renren':
          shareUrl = fxurl;
          shareText = fxdesc;
          shareDesc = '';
          shareComment = '';
          break;
        default :
          shareUrl = fxurl;
          shareText = fxtext;
          shareDesc = fxdesc;
          shareComment = fxcomment;
          break;
      }
    });
  });
  function SetShareUrl(cmd, config) {
    if (shareUrl) {
      config.bdUrl = "" + shareUrl;
    }
    if (shareText) {
      config.bdText = shareText;
    }
    if (shareDesc) {
      config.bdDesc = shareDesc;
    }
    if (shareComment) {
      config.bdComment = shareComment;
    }

    return config;
  }
  window._bd_share_config = {
    "common": {
      "onBeforeClick": SetShareUrl,
      "bdPic": "",
      "bdMini": "2",
      "searchPic": "1",
      "bdMiniList": false
    },
    "share": {
      "bdSize": "16"
    }
  };
  with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com{% static '' %}api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
</script>
</body>
</html>
